{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0376e19b-5756-41ce-85e8-391842b7b19f",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5dd9b760-0fd5-4db6-be9d-404bea11e606",
   "metadata": {},
   "source": [
    "### 观测参数设置"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "15d25e51-1c29-4a41-b4b2-50acdfb8eaf9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 观测相机参数\n",
    "camera_width_in_deg = 1.1   # deg\n",
    "camera_width_in_pix = 5\n",
    "\n",
    "camera_height_in_deg = 1.2  # deg\n",
    "camera_height_in_pix = 6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "fe205b22-4c61-4b10-8b11-8771a905191e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 观测天区规划 10 deg^2\n",
    "region_width_in_deg = np.sqrt(10) # deg\n",
    "region_height_in_deg = np.sqrt(10) # deg"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "15b4853a-9a38-47fe-b215-a802e201d190",
   "metadata": {},
   "outputs": [],
   "source": [
    "seconds_per_day = 86400\n",
    "\n",
    "# 定点观测时间\n",
    "fixed_t = 150 / seconds_per_day # days\n",
    "\n",
    "# 其他观测时间 （cadence）\n",
    "cadence = 10 # days"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c9d96aff-e76f-4c32-8f67-52d2caadf0c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# CSST总观测时间\n",
    "csst_lifetime = 10 * 365.25 \n",
    "\n",
    "# 用与SN的观测时间\n",
    "csst_for_sn_time = 2 * 365.25\n",
    "\n",
    "# 总体开始观测时间\n",
    "csst_start_mjd = 50000"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "aa7acaa8-928f-48c1-8ead-ce09adf6fc8f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# sncosmo模拟参数配置\n",
    "# 观测红移区间\n",
    "zmin = 0\n",
    "zmax = 2\n",
    "# 绝对星等分布\n",
    "M_mean = -19.3\n",
    "M_std  = 0.21233  # FWHM = 0.5 mag\n",
    "# 颜色分布\n",
    "x1_mean = 0.938\n",
    "x1_std = 0.5      # Pantheon U(-3, 3)\n",
    "c_mean = -0.062\n",
    "c_std  = 0.05     # Pantheon U(-0.3, 0.3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "2759ce9a-38e6-49bc-a0b6-5c2228b76c12",
   "metadata": {},
   "outputs": [],
   "source": [
    "# sn模型配置\n",
    "source = \"salt2-extended\"\n",
    "template_minimal_waves = {\n",
    "    \"salt2\": 2000,\n",
    "    \"salt2-extended\": 1700\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "6c85ab28-30ca-4475-9709-df44787f81dc",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 相机像素配置\n",
    "camera_pix_config = (\n",
    "    ('csst_y', 1, 0),\n",
    "    ('csst_i', 1, 1),\n",
    "    ('csst_g', 1, 2),\n",
    "    ('csst_r', 1, 3),\n",
    "    ('csst_z', 2, 0),\n",
    "    ('csst_NUV', 2, 1),\n",
    "    ('csst_NUV', 2, 2),\n",
    "    ('csst_u', 2, 3),\n",
    "    ('csst_y', 2, 4),\n",
    "    ('csst_y', 3, 0),\n",
    "    ('csst_u', 3, 1),\n",
    "    ('csst_NUV', 3, 2),\n",
    "    ('csst_NUV', 3, 3),\n",
    "    ('csst_z', 3, 4),\n",
    "    ('csst_r', 4, 1),\n",
    "    ('csst_g', 4, 2),\n",
    "    ('csst_i', 4, 3),\n",
    "    ('csst_y', 4, 4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "92eeb10f-e565-4d46-a114-b47f28d98aca",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 仪器参数配置\n",
    "eff_dict = {\n",
    "    \"csst_NUV\": 0.23,\n",
    "    \"csst_u\": 0.33,\n",
    "    \"csst_g\": 0.67,\n",
    "    \"csst_r\": 0.67,\n",
    "    \"csst_i\": 0.67,\n",
    "    \"csst_z\": 0.6,\n",
    "    \"csst_y\": 0.32,\n",
    "}\n",
    "\n",
    "dLambda_dict = {\n",
    "    \"csst_NUV\": 608.3,\n",
    "    \"csst_u\": 759.2,\n",
    "    \"csst_g\": 1356.6,\n",
    "    \"csst_r\": 1435.3,\n",
    "    \"csst_i\": 1535.8,\n",
    "    \"csst_z\": 1173.2,\n",
    "    \"csst_y\": 750.8,\n",
    "}\n",
    "\n",
    "Lambda_dict = {\n",
    "    \"csst_NUV\": 2884.9,\n",
    "    \"csst_u\": 3685.9,\n",
    "    \"csst_g\": 4708.7,\n",
    "    \"csst_r\": 6093.9,\n",
    "    \"csst_i\": 7556.6,\n",
    "    \"csst_z\": 9059.1,\n",
    "    \"csst_y\": 9825.0,\n",
    "}\n",
    "\n",
    "\n",
    "def calc_X(eff, dLambda, Lambda, t=None, S=None, gain=1.5):\n",
    "    X = 6.626e-27*gain/S/eff/t/(dLambda/Lambda)\n",
    "    return X\n",
    "\n",
    "def calc_mab(eff, dLambda, Lambda, t=None, S=None, gain=1.5):\n",
    "    X = calc_X(eff, dLambda, Lambda, t, S, gain)\n",
    "    return -2.5*np.log10(X) - 48.6\n",
    "\n",
    "def calc_mvega(eff, dLambda, Lambda, f0, t=None, S=None, gain=1.5):\n",
    "    X = calc_X(eff, dLambda, Lambda, t, S, gain) * 1e23\n",
    "    return -2.5*np.log10(X/f0)\n",
    "\n",
    "#\n",
    "def get_zp_dict(t):\n",
    "    \"\"\"t，曝光时间，单位，秒\"\"\"\n",
    "    S = np.pi * 10000 # cm^2\n",
    "    zp_dict = dict() #ab星等\n",
    "\n",
    "    for key in eff_dict.keys():\n",
    "        # skynoise_dict[key] = 4 * np.pi * 0.744 * 300 * np.sqrt(skynoise_dict[key])# 假设曝光时间150秒\n",
    "        eff, dLambda, Lambda = eff_dict[key], dLambda_dict[key], Lambda_dict[key]\n",
    "        # 写你的函数\n",
    "        # val = fn(eff, dLambda, Lambda)\n",
    "        val = calc_mab(eff, dLambda, Lambda, t=t, S=S, gain=1.5)\n",
    "        zp_dict[key] = val\n",
    "        # xxx_dict[key] = some_function(...)\n",
    "#         print(\"key={key}, val={val}\".format(key=key, val=val))\n",
    "\n",
    "    return zp_dict\n",
    "\n",
    "def get_skynoise_dict(t):\n",
    "    \"\"\"t - 曝光时间，单位，秒\"\"\"\n",
    "    skynoise_dict = {\n",
    "        \"csst_NUV\": 0.003, # e^- s^-1 pixel^-1, sncosmo中的skynoise是什么\n",
    "        \"csst_u\":0.018,\n",
    "        \"csst_g\":0.156,\n",
    "        \"csst_r\":0.2,\n",
    "        \"csst_i\":0.207,\n",
    "        \"csst_z\":0.123,\n",
    "        \"csst_y\":0.036,\n",
    "    }\n",
    "    for key in skynoise_dict.keys():\n",
    "        skynoise_dict[key] = 4 * np.pi * 0.744 * np.sqrt(skynoise_dict[key] * t/1.5)# 假设曝光时间150秒\n",
    "    return skynoise_dict"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b08e31af-d648-4d79-b7fc-ffc13f369ce1",
   "metadata": {},
   "source": [
    "* * *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "c58b90eb-e202-4ab8-a2e1-c24d488a7a00",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 像素点参数\n",
    "pixel_width = camera_width_in_deg / camera_width_in_pix # deg\n",
    "pixel_height = camera_height_in_deg / camera_height_in_pix # deg\n",
    "\n",
    "pixel_area = pixel_width * pixel_height # square degee"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "92236261-684c-4c8a-a1ed-0f0d4488521e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 等效像素点个数\n",
    "region_width_in_pix = round(region_width_in_deg / pixel_width)\n",
    "region_height_in_pix = round(region_height_in_deg / pixel_height)\n",
    "n_pix_in_region = region_width_in_pix * region_height_in_pix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "352a5b19-5850-4c8b-a842-9b6f136d6fe2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 水平扫描, 垂直扫描总次数, 计算一次小天区观测总时间\n",
    "# 忽略望远镜转向时间\n",
    "scan_left_right = region_width_in_pix - camera_width_in_pix + 1\n",
    "scan_top_down = region_height_in_pix - camera_height_in_pix + 1\n",
    "n_fixed_views = scan_left_right * scan_top_down # region天区一次完整扫描, 需要镜头指向的总方向个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "4fce3331-4f7d-4f7b-8eba-f35004ccab68",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "小天区观测一次需要时间4.58小时\n"
     ]
    }
   ],
   "source": [
    "t_per_region = n_fixed_views * fixed_t\n",
    "print(f\"小天区观测一次需要时间{t_per_region * 24:.2f}小时\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "5eb41121-8459-466d-b7ef-b175dcdb08c7",
   "metadata": {},
   "outputs": [],
   "source": [
    "skynoise_dict = get_skynoise_dict(fixed_t * seconds_per_day) # fixed_t观测时间单位day\n",
    "zp_dict = get_zp_dict(fixed_t * seconds_per_day)\n",
    "\n",
    "wave0 = template_minimal_waves[source]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "60c1cb5e-f897-43d2-8e14-10f5ce12a2c7",
   "metadata": {},
   "source": [
    "### 生成观测计划\n",
    "整个运行期可以划分为连续若干个“单次小天区观测 + 其他观测“子单元，首先生成一个子单元的观测计划，然后推出整个运行期的观测计划"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "90f230b0-6f8e-4548-86dc-55ca189c7052",
   "metadata": {},
   "outputs": [],
   "source": [
    "def region_id(loc_row, loc_col,row, col):\n",
    "    reg_row = row + loc_row\n",
    "    reg_col = col + loc_col\n",
    "    return reg_row * region_width_in_pix + reg_col"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "c073729b-45f8-4c88-bb88-01ab529a1326",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "73.0"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 单次小天区观测 + 其他观测时间\n",
    "period = cadence\n",
    "\n",
    "# 总观测次数\n",
    "n_obs = np.floor(csst_for_sn_time / period)\n",
    "n_obs"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "08c35c82-ac2b-4ea4-b8ee-e7e0545fc40b",
   "metadata": {},
   "source": [
    "```python\n",
    "# 为region天区中的每一个定点观测像素构建观测计划\n",
    "schedules = [[] for i in range(n_pix_in_region)]\n",
    "timestamp = 0\n",
    "for col in range(scan_left_right):\n",
    "    for row in range(scan_top_down):\n",
    "        # 记录region内当前被相机观测的天空，波段和时间戳\n",
    "        for band, loc_row, loc_col in camera_pix_config:\n",
    "            id_ = region_id(loc_row, loc_col, row, col)\n",
    "            schedules[id_].append((band, timestamp))\n",
    "        # 累计 fixed_t 观测时长之后, 挪动一个像素, 进入下一个观测\n",
    "        # 并且时间戳向前移动 fixed_t\n",
    "        timestamp += fixed_t\n",
    "\n",
    "# region观测完成后, 进入cadence期, 下一次回到region观测时, 时间戳累加\n",
    "# 一个cadence\n",
    "timestamp += cadence\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "c9b6bef4-07df-4108-a891-74840f528da9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 生成总体观测计划\n",
    "timestamp = 0\n",
    "schedules = [[] for i in range(n_pix_in_region)]\n",
    "\n",
    "for obs_id in np.arange(n_obs):\n",
    "    # 为region天区中的每一个定点观测像素构建观测计划\n",
    "    timestamp_enter = timestamp\n",
    "    for col in range(scan_left_right):\n",
    "        for row in range(scan_top_down):\n",
    "            # 记录region内当前被相机观测的天空，波段和时间戳\n",
    "            for band, loc_row, loc_col in camera_pix_config:\n",
    "                id_ = region_id(loc_row, loc_col, row, col)\n",
    "                schedules[id_].append((band, timestamp))\n",
    "            # 累计 fixed_t 观测时长之后, 挪动一个像素, 进入下一个观测\n",
    "            # 并且时间戳向前移动 fixed_t\n",
    "            timestamp += fixed_t\n",
    "\n",
    "    # region观测完成后, 进入cadence期, 下一次回到region观测时, 时间戳累加\n",
    "    timestamp = timestamp_enter + cadence"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb26cce7-7026-4d49-bcb2-a62e4ebc6f1a",
   "metadata": {},
   "source": [
    "### 辅助函数\n",
    "用来配置超新星参数，以及观测band截断"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "55435e9d-6312-46dc-b88e-3145ff48d920",
   "metadata": {},
   "outputs": [],
   "source": [
    "def config_sn_params(z, t0, x0, x1, c, csst_bands=None):\n",
    "    \"\"\"参考lc_simu\"\"\"\n",
    "    min_wave = wave0 * (1 + z)\n",
    "    params = {'z': z, 't0':t0, 'x0':x0, 'x1':x1, 'c':c}\n",
    "    if csst_bands is None:\n",
    "        csst_bands = load_csst_filter()\n",
    "    # cut bands\n",
    "    # 部分bands 变成空, 丢弃掉\n",
    "    valid_bands = []\n",
    "    for band_name in csst_bands.keys():\n",
    "        band_cutted = cut_filter_band(min_wave, band_name=band_name, csst_bands=csst_bands)\n",
    "        if band_cutted is not None:\n",
    "            # 修改注册表中的csst为cutted\n",
    "            sncosmo.registry.register(band_cutted, name=band_name, force=True)\n",
    "            valid_bands.append(band_name)\n",
    "#         else:\n",
    "#             print(f\"{band_name} is CUTTED!\")\n",
    "\n",
    "    return min_wave, params, valid_bands"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "30371983-4892-4513-81fd-606723804beb",
   "metadata": {},
   "outputs": [],
   "source": [
    "def cut_filter_band(wave_min=0, band_name=None, csst_bands=None):\n",
    "    \"\"\"参考lc_simu\"\"\"\n",
    "    if csst_bands is None:\n",
    "        csst_bands = load_csst_filter()\n",
    "       \n",
    "    try:\n",
    "         # 读取band_name对应的wave, band\n",
    "        wave_trans = csst_bands[band_name]\n",
    "    except KeyError:\n",
    "        print(\"有效的csst band_name如下\\n\" +\\\n",
    "            f\"{list(csst_bands.keys())}\")\n",
    "        print(f\"但你的输入band_name='{band_name}'不在其中\")\n",
    "        raise KeyError(f\"你输入的'{band_name}'', 不在上述csst_bands列表中\")\n",
    "        \n",
    "    # 选择 >= z_min 的band区间\n",
    "    valid_index = wave_trans[:, 0] >= wave_min\n",
    "    cutted_wave = wave_trans[valid_index, 0]\n",
    "    cutted_trans = wave_trans[valid_index, 1]\n",
    "    \n",
    "    # 如果cutted_trans全是 0 或者 空\n",
    "    # 则不能创建filter, 直接返回none\n",
    "    if np.all(cutted_trans == 0):\n",
    "        return None\n",
    "\n",
    "    # 创建sncosmo Bandpass\n",
    "    band_cutted = sncosmo.Bandpass(cutted_wave, cutted_trans, name=f\"{band_name}_cutted\")\n",
    "    return band_cutted"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "ba0d7643-0fd4-499f-8e99-e7c4cf07b69c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_csst_filter():\n",
    "    \"\"\"参考lc_simu\"\"\"\n",
    "    from pathlib import Path\n",
    "    setattr(Path, 'ls', lambda self:list(self.iterdir()))\n",
    "\n",
    "    csst_path = Path(\"./data/CSSOS_Throughput\")\n",
    "    assert csst_path.is_dir(), \"{str(csst_path)} 不存在 \"\n",
    "    # csst_path.ls() # 打印目录\n",
    "\n",
    "    csst_bands = dict()\n",
    "    for band_file in csst_path.iterdir():\n",
    "        if band_file.is_dir():continue\n",
    "        if band_file.name == \".DS_Store\":continue\n",
    "        key = 'csst_' + band_file.stem.split('_')[0]\n",
    "        csst_bands[key] = np.loadtxt(band_file)\n",
    "        band = sncosmo.Bandpass(*csst_bands[key].T, name=key)\n",
    "        sncosmo.registry.register(band, force=True)   \n",
    "    return csst_bands\n",
    "    \n",
    "# alias\n",
    "def reset_csst_filter():\n",
    "    _ = load_csst_filter()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "41be8d47-dbeb-4116-b333-3b7b7a8f3ea6",
   "metadata": {},
   "source": [
    "### 生成光变曲线\n",
    "\n",
    "为schedules中每个像素天区生成SN, 并记录其光变曲线. 然后推广到region中的所有像素天区."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "25c24528-ff24-4848-9f11-3d7cdc1ff579",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sncosmo, astropy, pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "517a6d66-4d81-464a-a81c-febf3bb588b7",
   "metadata": {},
   "outputs": [],
   "source": [
    "salt2_model = sncosmo.Model(source=source)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "231effae-aba6-4cca-960c-6299c89b5a5e",
   "metadata": {},
   "outputs": [],
   "source": [
    " def gen_sn_params_in_pix(region_pix_id=None):\n",
    "    # 计算region中一个像素上SN的param分布\n",
    "    sn_in_pix = sncosmo.zdist(zmin = zmin,\n",
    "                              zmax = zmax,\n",
    "                              time = csst_for_sn_time,\n",
    "                              area = pixel_area,\n",
    "                              # ratefunc = , 服务器上修改\n",
    "                              # cosmo = , 服务器上修改\n",
    "                             )\n",
    "\n",
    "    x0dist = []\n",
    "    x1dist = []\n",
    "    cdist  = []\n",
    "    t0dist = []\n",
    "    Mdist  = []\n",
    "    mbdist = []\n",
    "    zdist = []\n",
    "    for z in sn_in_pix:\n",
    "        # 随机绝对星等\n",
    "        mabs = np.random.normal(M_mean, M_std)\n",
    "        salt2_model.set(z = z)\n",
    "        salt2_model.set_source_peakabsmag(mabs, \"bessellb\", \"ab\")\n",
    "        # 计算视星等\n",
    "        x0 = salt2_model.get(\"x0\")\n",
    "        mb = salt2_model.source_peakmag(\"bessellb\", \"ab\")\n",
    "        # 随机爆发时间\n",
    "        t0 = np.random.uniform(low = csst_start_mjd, high = csst_start_mjd + csst_for_sn_time)\n",
    "        # 随机颜色\n",
    "        x1 = np.random.normal(x1_mean, x1_std)\n",
    "        c  = np.random.normal(c_mean, c_std)\n",
    "        # 记录\n",
    "        x0dist.append(x0)\n",
    "        x1dist.append(x1)\n",
    "        cdist.append(c)\n",
    "        t0dist.append(t0)\n",
    "        Mdist.append(mabs)\n",
    "        mbdist.append(mb)\n",
    "        zdist.append(z)\n",
    "\n",
    "    # 合成一个pix天区内，SN的params\n",
    "    return list(zip(zdist, t0dist, x0dist, x1dist, cdist, Mdist, mbdist))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "4aee761e-4e36-4a25-99ae-6455f01a66de",
   "metadata": {},
   "outputs": [],
   "source": [
    "params_pix = gen_sn_params_in_pix()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "8bcb6a99-280c-420b-b793-0b64aec16683",
   "metadata": {},
   "outputs": [],
   "source": [
    " def gen_observe_in_pix(region_pix_id):\n",
    "    # 对一个pix天区内, params_pix定义的SN, 按照观测计划schedule生成光变曲线\n",
    "    # 根据天区pix id取出观测计划\n",
    "    times = []\n",
    "    bands = []\n",
    "    gains = []\n",
    "    skynoises = []\n",
    "    zps = []\n",
    "    zpsyses = []\n",
    "    for band, rel_time in schedules[region_pix_id]:\n",
    "        times.append(rel_time + csst_start_mjd)\n",
    "        bands.append(band)\n",
    "        gains.append(1.5)\n",
    "        skynoises.append(skynoise_dict[band])\n",
    "        zps.append(zp_dict[band])\n",
    "        zpsyses.append('ab')\n",
    "\n",
    "    df = pd.DataFrame({\n",
    "        \"time\": times,\n",
    "        \"band\": bands,\n",
    "        \"gain\": gains,\n",
    "        \"skynoise\": skynoises,\n",
    "        \"zp\": zps,\n",
    "        \"zpsys\": zpsyses}).sort_values([\"time\", \"band\"])\n",
    "\n",
    "    observation = astropy.table.Table({\n",
    "        \"time\": df.time,\n",
    "        \"band\": df.band,\n",
    "        \"gain\": df.gain,\n",
    "        \"skynoise\": df.skynoise,\n",
    "        \"zp\":   df.zp,\n",
    "        \"zpsys\":df.zpsys})\n",
    "    return observation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "620610d4-8d54-4c4e-9acd-4e8c6a3997de",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1.0621282959437384,\n",
       " 50162.802861510274,\n",
       " 1.6589874285044749e-06,\n",
       " 0.9569824941838654,\n",
       " 0.059542338676320125,\n",
       " -19.348934209268855,\n",
       " 24.952462207699423)"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "params_pix[0] # zdist, t0dist, x0dist, x1dist, cdist, Mdist, mbdist"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "3b87ad71-0075-4e55-8b15-805e54effa98",
   "metadata": {},
   "outputs": [
    {
     "ename": "AssertionError",
     "evalue": "{str(csst_path)} 不存在 ",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAssertionError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-45-5fed7206f83f>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      4\u001b[0m min_wave, sn_params, valid_bands = config_sn_params(\n\u001b[0;32m----> 5\u001b[0;31m     *params_pix[0][:5])\n\u001b[0m",
      "\u001b[0;32m<ipython-input-39-c7eecc3f3d7f>\u001b[0m in \u001b[0;36mconfig_sn_params\u001b[0;34m(z, t0, x0, x1, c, csst_bands)\u001b[0m\n\u001b[1;32m      4\u001b[0m     \u001b[0mparams\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m'z'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mz\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m't0'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mt0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'x0'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mx0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'x1'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mx1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'c'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mcsst_bands\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m         \u001b[0mcsst_bands\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mload_csst_filter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      7\u001b[0m     \u001b[0;31m# cut bands\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      8\u001b[0m     \u001b[0;31m# 部分bands 变成空, 丢弃掉\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m<ipython-input-40-3f81f13f2ddb>\u001b[0m in \u001b[0;36mload_csst_filter\u001b[0;34m()\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      6\u001b[0m     \u001b[0mcsst_path\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPath\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"./data/CSSOS_Throughput\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 7\u001b[0;31m     \u001b[0;32massert\u001b[0m \u001b[0mcsst_path\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_dir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"{str(csst_path)} 不存在 \"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      8\u001b[0m     \u001b[0;31m# csst_path.ls() # 打印目录\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      9\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mAssertionError\u001b[0m: {str(csst_path)} 不存在 "
     ]
    }
   ],
   "source": [
    "# 对于1个pix中的1个sn,其光变曲线为\n",
    "params_pix[0]\n",
    "\n",
    "min_wave, sn_params, valid_bands = config_sn_params(\n",
    "    *params_pix[0][:5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "a81a3eea-eaa2-4cd9-ba3e-e1ea182fea55",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(0.9661428582855829,\n",
       "  50251.187009224726,\n",
       "  2.0904232180970895e-06,\n",
       "  1.1655055846325433,\n",
       "  -0.11160602323024615,\n",
       "  -19.344505742062754,\n",
       "  24.701484394270366),\n",
       " (1.9404545288260262,\n",
       "  50043.315030931415,\n",
       "  4.3127438135419067e-07,\n",
       "  0.8822143524856225,\n",
       "  -0.1303352148772028,\n",
       "  -19.507716327300717,\n",
       "  26.415185793121875),\n",
       " (1.7187404267915638,\n",
       "  50530.00536314082,\n",
       "  4.901157890902768e-07,\n",
       "  0.6158040638837937,\n",
       "  0.01621045021367923,\n",
       "  -19.32180066164015,\n",
       "  26.27632321142695),\n",
       " (1.0164211363562847,\n",
       "  50720.703933423065,\n",
       "  1.5177458838747851e-06,\n",
       "  0.6020539899099362,\n",
       "  -0.06309533389850104,\n",
       "  -19.13367611544762,\n",
       "  25.049072285935175),\n",
       " (1.7551292861463403,\n",
       "  50301.04084622525,\n",
       "  4.047104254114614e-07,\n",
       "  0.48484970079163425,\n",
       "  -0.005155141158714446,\n",
       "  -19.170087966442857,\n",
       "  26.484208965192195),\n",
       " (0.6764814103645153,\n",
       "  50323.99754477906,\n",
       "  4.176705625602832e-06,\n",
       "  1.665927216114133,\n",
       "  -0.032180530400684824,\n",
       "  -19.140447247638843,\n",
       "  23.94998527716259),\n",
       " (1.7486311821040244,\n",
       "  50392.351531156535,\n",
       "  4.721564988195674e-07,\n",
       "  0.6012525831589107,\n",
       "  -0.0252258247128182,\n",
       "  -19.327499426184488,\n",
       "  26.316855015922528),\n",
       " (1.6853286637581917,\n",
       "  50424.835106311824,\n",
       "  4.83403890241845e-07,\n",
       "  1.0902959342096346,\n",
       "  -0.05055508306358815,\n",
       "  -19.254162564333527,\n",
       "  26.291294592499725),\n",
       " (1.6560581589386412,\n",
       "  50503.0282958254,\n",
       "  5.540630879412131e-07,\n",
       "  0.4043864538728742,\n",
       "  -0.08668860746469922,\n",
       "  -19.355256000328644,\n",
       "  26.143171899959647),\n",
       " (0.7988552712676265,\n",
       "  50698.46689160649,\n",
       "  2.239006249486265e-06,\n",
       "  1.274578979942497,\n",
       "  0.047977803003496466,\n",
       "  -18.907845878763784,\n",
       "  24.62693168084108),\n",
       " (0.7343987928263519,\n",
       "  50686.87592862621,\n",
       "  4.118931877185273e-06,\n",
       "  0.36575088387739796,\n",
       "  -0.06725647183740148,\n",
       "  -19.344457564479356,\n",
       "  23.96510842218515),\n",
       " (0.929165968001457,\n",
       "  50348.10855563581,\n",
       "  1.6528659729319754e-06,\n",
       "  0.8659967566757828,\n",
       "  -0.033145882647693234,\n",
       "  -18.98439449331456,\n",
       "  24.956475847618854),\n",
       " (1.0028040934849638,\n",
       "  50390.6691359614,\n",
       "  1.8735245711218243e-06,\n",
       "  0.14962593655701228,\n",
       "  -0.10369064133023767,\n",
       "  -19.325958175496137,\n",
       "  24.82042146227659),\n",
       " (0.998081129310664,\n",
       "  50014.93851110855,\n",
       "  1.8751721830782458e-06,\n",
       "  0.823894405518093,\n",
       "  -0.039999652604278776,\n",
       "  -19.31418445304569,\n",
       "  24.81946706549021),\n",
       " (1.6076960301762127,\n",
       "  50521.75800631002,\n",
       "  6.432610234118627e-07,\n",
       "  -0.049960228227479475,\n",
       "  -0.062267115592957584,\n",
       "  -19.437718553349942,\n",
       "  25.981101851916538),\n",
       " (0.6345599094690462,\n",
       "  50555.11884517391,\n",
       "  6.702098894194408e-06,\n",
       "  1.0248055468088384,\n",
       "  -0.09227802588216547,\n",
       "  -19.483847104080866,\n",
       "  23.436542865616694),\n",
       " (1.7400849776835006,\n",
       "  50294.1613395784,\n",
       "  4.23894190507955e-07,\n",
       "  2.0793209089388887,\n",
       "  0.01689336507218707,\n",
       "  -19.19729380475205,\n",
       "  26.433926283835145),\n",
       " (0.6829835616013533,\n",
       "  50643.171931994184,\n",
       "  4.652409796774147e-06,\n",
       "  1.441995106137489,\n",
       "  -0.07811637174978919,\n",
       "  -19.283031437828722,\n",
       "  23.83287504136652),\n",
       " (0.6597187082293549,\n",
       "  50516.33403957516,\n",
       "  5.784249204744666e-06,\n",
       "  -0.02788455063441808,\n",
       "  -0.10326541291849561,\n",
       "  -19.427219042317358,\n",
       "  23.596452456425997),\n",
       " (1.8154220892754926,\n",
       "  50370.83335559876,\n",
       "  4.090605122014394e-07,\n",
       "  1.4796217374315213,\n",
       "  -0.05703523992488502,\n",
       "  -19.27217652286582,\n",
       "  26.472601050749077),\n",
       " (1.8091950393455256,\n",
       "  50335.96897853319,\n",
       "  4.1252485378554986e-07,\n",
       "  0.7629903408208039,\n",
       "  -0.03995023884827162,\n",
       "  -19.272132844948274,\n",
       "  26.46344464769706),\n",
       " (1.9975300505234865,\n",
       "  50404.19418120523,\n",
       "  2.889014138760535e-07,\n",
       "  0.9084311074049621,\n",
       "  -0.08709844128287596,\n",
       "  -19.150101723423347,\n",
       "  26.850195777097788),\n",
       " (1.345219733730893,\n",
       "  50221.62056089605,\n",
       "  1.2027319963261606e-06,\n",
       "  0.3835797023606049,\n",
       "  -0.050371282482652074,\n",
       "  -19.63729812245112,\n",
       "  25.301647783593985),\n",
       " (1.2539033196570664,\n",
       "  50024.106625648266,\n",
       "  8.624697950683277e-07,\n",
       "  0.4503905793000927,\n",
       "  -0.09119947459969757,\n",
       "  -19.086621027496342,\n",
       "  25.662710209299313),\n",
       " (1.1622197932890028,\n",
       "  50409.514727852846,\n",
       "  9.290325439862312e-07,\n",
       "  0.4453951624686933,\n",
       "  -0.09294476134272292,\n",
       "  -18.962429923840592,\n",
       "  25.581992626324478),\n",
       " (0.8413490686222103,\n",
       "  50541.27118331368,\n",
       "  2.2722277808599227e-06,\n",
       "  0.783580181881942,\n",
       "  -0.05267987342599343,\n",
       "  -19.062919648920015,\n",
       "  24.61094028194488),\n",
       " (1.632497925852575,\n",
       "  50186.969165355775,\n",
       "  4.3841382091439124e-07,\n",
       "  0.5049739156204809,\n",
       "  -0.02868151505466935,\n",
       "  -19.062589253523747,\n",
       "  26.397359353423425),\n",
       " (1.6914453270741165,\n",
       "  50608.08969755768,\n",
       "  6.480272130201318e-07,\n",
       "  1.5257732187228603,\n",
       "  -0.09435472119827659,\n",
       "  -19.582091879892644,\n",
       "  25.973086835639336),\n",
       " (1.2115698836397164,\n",
       "  50297.05101458509,\n",
       "  1.192454280539929e-06,\n",
       "  1.7447189458418695,\n",
       "  -0.10757748685789001,\n",
       "  -19.345688316467495,\n",
       "  25.3109656030286),\n",
       " (1.5173934505212792,\n",
       "  50384.89664080001,\n",
       "  5.494362620148298e-07,\n",
       "  1.8806369186726606,\n",
       "  0.012029244953701876,\n",
       "  -19.11110120781352,\n",
       "  26.152276648158917),\n",
       " (1.0663430526079982,\n",
       "  50501.43047291851,\n",
       "  1.3606240051292861e-06,\n",
       "  0.1717895659648232,\n",
       "  -0.03435361727870059,\n",
       "  -19.144356701054946,\n",
       "  25.167724623199295),\n",
       " (0.4765786017323519,\n",
       "  50072.15316562162,\n",
       "  9.93088018152633e-06,\n",
       "  1.2619771193582283,\n",
       "  -0.0353218341274363,\n",
       "  -19.15771392127287,\n",
       "  23.00960059015059),\n",
       " (0.5752449349965785,\n",
       "  50277.619741918876,\n",
       "  8.37437790828191e-06,\n",
       "  0.16694521322416844,\n",
       "  -0.09596226628775589,\n",
       "  -19.466023692657195,\n",
       "  23.194688557069227),\n",
       " (0.9013138682800734,\n",
       "  50482.243360462446,\n",
       "  1.9356977969656455e-06,\n",
       "  1.7357971746596408,\n",
       "  -0.02773724713876459,\n",
       "  -19.07397353631727,\n",
       "  24.784976055823712),\n",
       " (0.9921979779055263,\n",
       "  50284.59297319896,\n",
       "  1.949877154761612e-06,\n",
       "  1.2244771219594603,\n",
       "  -0.05595278422533263,\n",
       "  -19.34066163652122,\n",
       "  24.777051817764175),\n",
       " (0.8669217260757218,\n",
       "  50328.75111290679,\n",
       "  2.921290525516839e-06,\n",
       "  1.211922749430451,\n",
       "  -0.07413375289993693,\n",
       "  -19.416181152627864,\n",
       "  24.33813306983748),\n",
       " (1.1520495488469993,\n",
       "  50718.94142790058,\n",
       "  1.229512351953553e-06,\n",
       "  1.0458627383923365,\n",
       "  -0.11172466463895976,\n",
       "  -19.242963595206632,\n",
       "  25.277737704998064),\n",
       " (1.8586610048029693,\n",
       "  50264.28358000974,\n",
       "  3.934232351860407e-07,\n",
       "  1.6142494702745371,\n",
       "  -0.09090523357120593,\n",
       "  -19.292854847833894,\n",
       "  26.514919931931004),\n",
       " (1.2850830666120352,\n",
       "  50580.1192289441,\n",
       "  9.073867304449161e-07,\n",
       "  0.8130731946714811,\n",
       "  0.07822225575254146,\n",
       "  -19.208009585901795,\n",
       "  25.607588885569456),\n",
       " (1.5170726636304237,\n",
       "  50616.056785933106,\n",
       "  6.229631036353869e-07,\n",
       "  1.303630135399315,\n",
       "  0.010087210729263371,\n",
       "  -19.246894822475795,\n",
       "  26.01591413185686),\n",
       " (1.4822640033708947,\n",
       "  50382.925651466474,\n",
       "  5.87213380819667e-07,\n",
       "  0.6101703349072708,\n",
       "  -0.04713034357333044,\n",
       "  -19.120255845806913,\n",
       "  26.080080087084916),\n",
       " (1.3324834147296838,\n",
       "  50023.763546963586,\n",
       "  9.61400218494558e-07,\n",
       "  0.002068837052804251,\n",
       "  -0.05228738145445768,\n",
       "  -19.3684846855912,\n",
       "  25.544809404052586),\n",
       " (0.7402019011262949,\n",
       "  50290.39442137439,\n",
       "  3.238872958454443e-06,\n",
       "  -0.17782218309795805,\n",
       "  -0.12964189363245465,\n",
       "  -19.104519055926872,\n",
       "  24.22608516134),\n",
       " (1.979312637723176,\n",
       "  50102.18205668072,\n",
       "  2.664137556429919e-07,\n",
       "  1.0149924669293517,\n",
       "  -0.08457165391951268,\n",
       "  -19.037667978794754,\n",
       "  26.938178333177024),\n",
       " (0.8607542703103817,\n",
       "  50445.92148937694,\n",
       "  3.008409026569816e-06,\n",
       "  1.0505233680349069,\n",
       "  -0.10296794424744604,\n",
       "  -19.428896034510878,\n",
       "  24.30622773757351),\n",
       " (1.1624561801925428,\n",
       "  50503.02728786938,\n",
       "  1.3929247195230742e-06,\n",
       "  1.0335371177837733,\n",
       "  -0.17394508161790284,\n",
       "  -19.402720600618423,\n",
       "  25.14225083114514),\n",
       " (0.5709676376015764,\n",
       "  50407.92623666066,\n",
       "  5.9448453986985955e-06,\n",
       "  1.1433730956943027,\n",
       "  -0.041148845055756854,\n",
       "  -19.07430685431762,\n",
       "  23.56671853312447),\n",
       " (0.8026248119959044,\n",
       "  50136.33738183109,\n",
       "  3.552338606691104e-06,\n",
       "  0.6394066248335755,\n",
       "  0.041031997475307,\n",
       "  -19.42161681819565,\n",
       "  24.125784055892083),\n",
       " (0.998011386947973,\n",
       "  50315.29349497397,\n",
       "  1.7275231946063346e-06,\n",
       "  1.4652779210647833,\n",
       "  -0.10152334586996725,\n",
       "  -19.22495289479334,\n",
       "  24.908510227425445),\n",
       " (0.5814771836910193,\n",
       "  50357.52457844736,\n",
       "  6.630882130989147e-06,\n",
       "  0.24672895781431126,\n",
       "  -0.08822682012520852,\n",
       "  -19.241010877234572,\n",
       "  23.44814167512765),\n",
       " (1.928595370994848,\n",
       "  50563.86810831621,\n",
       "  4.1155241655942517e-07,\n",
       "  1.2679556082510421,\n",
       "  -0.10435600431163077,\n",
       "  -19.440517849723857,\n",
       "  26.466007054964713),\n",
       " (1.341088577471341,\n",
       "  50392.69413358388,\n",
       "  7.29467622922945e-07,\n",
       "  0.7149836386082089,\n",
       "  -0.015823354968384454,\n",
       "  -19.086097618880714,\n",
       "  25.844554893533473),\n",
       " (0.9942006091156708,\n",
       "  50671.552350235674,\n",
       "  1.3227741737890608e-06,\n",
       "  0.4708976917850614,\n",
       "  -0.05909189324126111,\n",
       "  -18.924793543063014,\n",
       "  25.198355677690802),\n",
       " (1.1057904380437698,\n",
       "  50087.75546156777,\n",
       "  1.7917863042253245e-06,\n",
       "  1.7340357422959767,\n",
       "  -0.016666568061283506,\n",
       "  -19.541244729754506,\n",
       "  24.868854413597326),\n",
       " (1.2109004830799304,\n",
       "  50379.77050026651,\n",
       "  1.0733037388312834e-06,\n",
       "  0.5721636074666805,\n",
       "  -0.11298423960625079,\n",
       "  -19.229899121382008,\n",
       "  25.425263339738944),\n",
       " (0.6998519880960407,\n",
       "  50249.6292646674,\n",
       "  3.988484988611192e-06,\n",
       "  0.7255175631456591,\n",
       "  0.03702772191975523,\n",
       "  -19.180882362344807,\n",
       "  24.000050040676115),\n",
       " (1.3336209377403425,\n",
       "  50486.01431838842,\n",
       "  8.155215694801465e-07,\n",
       "  -0.021359729866349042,\n",
       "  -0.053150215301330794,\n",
       "  -19.19211389437068,\n",
       "  25.723481315161457),\n",
       " (0.6643616156736221,\n",
       "  50160.671395052384,\n",
       "  4.441354113318599e-06,\n",
       "  0.015563526614854162,\n",
       "  -0.08267529923954331,\n",
       "  -19.159041219111753,\n",
       "  23.883281442137438),\n",
       " (1.8910197396108712,\n",
       "  50188.45377653484,\n",
       "  3.8290646985821196e-07,\n",
       "  1.5868396316251525,\n",
       "  -0.05310976551026692,\n",
       "  -19.309598182170085,\n",
       "  26.544338183896087),\n",
       " (1.8248520563273163,\n",
       "  50537.975560290644,\n",
       "  4.1621668997894987e-07,\n",
       "  0.2258784243967814,\n",
       "  -0.08779219833282983,\n",
       "  -19.30487666696345,\n",
       "  26.453771217511942),\n",
       " (1.1747825667547387,\n",
       "  50217.362718706034,\n",
       "  1.1082694855828823e-06,\n",
       "  0.1115888004050658,\n",
       "  -0.03210415173952121,\n",
       "  -19.18298270086507,\n",
       "  25.390456505786997),\n",
       " (0.9615654324943226,\n",
       "  50647.164479431965,\n",
       "  2.0514269568963962e-06,\n",
       "  0.8970735618056507,\n",
       "  -0.09624902721747872,\n",
       "  -19.311263628070776,\n",
       "  24.721929800061517),\n",
       " (1.2662111673264174,\n",
       "  50088.914873180605,\n",
       "  8.437779749742721e-07,\n",
       "  1.129911117268315,\n",
       "  -0.14631504302286447,\n",
       "  -19.089186263005807,\n",
       "  25.686499483131314),\n",
       " (1.6559355368150657,\n",
       "  50415.47467705719,\n",
       "  5.590257866858459e-07,\n",
       "  1.8001416049448764,\n",
       "  -0.0032822927867150464,\n",
       "  -19.364738747810534,\n",
       "  26.133490341683427),\n",
       " (1.1642164309957683,\n",
       "  50042.42794410256,\n",
       "  1.0042414501094215e-06,\n",
       "  0.4681134134817402,\n",
       "  -0.05834962846816085,\n",
       "  -19.051580573611215,\n",
       "  25.49747458795656),\n",
       " (0.5462802119387029,\n",
       "  50434.13958324179,\n",
       "  6.337352646683293e-06,\n",
       "  1.1642125492954678,\n",
       "  -0.10948194888564305,\n",
       "  -19.027323093775156,\n",
       "  23.497300259196564),\n",
       " (1.9443099631467862,\n",
       "  50601.19031041489,\n",
       "  3.734006515196484e-07,\n",
       "  1.603942876601919,\n",
       "  -0.09673353967539593,\n",
       "  -19.35657178231255,\n",
       "  26.571632266829745)]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(params_pix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8260c2af-750d-47ca-9820-82571ad16118",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
